﻿<?php
    @session_start();
    include_once("../initial.php");
    $smarty->assign("projectUrl", constant('PROJECT_URL'));
		$DOCUMENT_ROOT=$_SERVER["DOCUMENT_ROOT"];
		include_once(constant('PROJECT_DIR')."/logic/messageLogic.php");
		$login = false;
    if(!isset($_SESSION['user']) || $_SESSION['user']=="")
    {
        $smarty->display("user/login.html");
    }
    else
    {
        $uid = $_SESSION['user'];
        if(!isset($uid) || $uid==false)
        {
            $smarty->display("user/login.html");
            exit;
        }
        else
        {
            //登录成功，开始读取用户的邮箱信息
            $mh = new messageLogic();
            $login=true;
            $USER_ID = $uid;
            $unReadNum=$mh->get_unread_message_num($uid);
            $smarty->assign("unReadNum", $unReadNum);
        }
    }
?>
